home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / dejagnu.lha / dejagnu-1.0.1 / dejagnu / runtest < prev    next >
Text File  |  1993-05-11  |  1KB  |  63 lines

  1. #!/bin/sh
  2. #
  3. # runtest -- basically all this script does is find the proper expect shell and then
  4. #            run DejaGnu. <rob@cygnus.com>
  5. #
  6.  
  7. #
  8. # Get the execution path to this script and the current directory.
  9. #
  10. execpath=`expr ${0-.}'/' : '\(/\)[^/]*//*$' \| ${0-.}'/' : '\(.*[^/]\)//*[^/][^/]*//*$' \| .`
  11. rootme=`pwd`
  12. #
  13. # set some default values
  14. #
  15. args=$@
  16. srcdir=.
  17.  
  18. #
  19. # Find the right expect binary to use. If a variable EXPECT exists,
  20. # it takes precedence over all other tests. Otherwise look for a freshly
  21. # built one, and then use one in the path.
  22. #
  23. if [ ! "$EXPECT" ]; then
  24.   if [ -f ${rootme}/../../expect/expect ] ; then
  25.     expectbin=${rootme}/../../expect/expect ;
  26.   else \
  27.     if [ -f ${rootme}/../expect/expect ] ; then
  28.       expectbin=${rootme}/../expect/expect ;
  29.     else \
  30.       expectbin=expect ; \
  31.     fi; \
  32.   fi
  33. else
  34.   expectbin=$EXPECT
  35. fi
  36.  
  37. # just to be safe...
  38. if [ ! "$expectbin" ]; then
  39.   echo "ERROR: No expect shell found"
  40.   exit 1
  41. fi
  42.  
  43. #
  44. # Extract the srcdir and target from the option list.
  45. #
  46. #while [ "$1" ] ; do
  47. #  case $1 in
  48. #    -sr*|--sr*|+sr*|++s*) shift ; srcdir=$1 ;;
  49. #    -t*|--t*|+t*|++t*) shift ; target=$1 ;;
  50. #  esac
  51. #  shift
  52. #done
  53.  
  54. if [ ! -f $execpath/runtest.exp ] ; then
  55.   execpath=$execpath/../lib/dejagnu
  56.   if [ ! -f $execpath/runtest.exp ] ; then
  57.     echo "Runtest.exp does not exist"
  58.     exit 1
  59.   fi
  60. fi
  61.  
  62. exec $expectbin -- $execpath/runtest.exp $args
  63.